<template>
  <div class="mask" v-show="visible" @click="Close">
    <div class="messageBox">
      <div class="header">
        <slot name="header">
          <span>{{ title }}</span>
          <span>X</span>
        </slot>
      </div>
      <div class="center">
        <slot name="center"></slot>
      </div>
      <div class="footer">
        <slot name="footer"></slot>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Mydialog",
  props: {
    visible: {
      type: Boolean,
      default: true,
    },
    title: {
      type: String,
      default: "提示",
    },
  },
  data() {
    return {
      title: "提示",
    };
  },
  methods: {
    Close() {
      this.$emit("close", !this.visible);
    },
  },
  created() {},
  mounted() {
  },
  computed: {},
  watch: {},
};
</script>

<style lang="scss" scoped>
.mask {
  width: 100vw;
  height: 100vh;
  background-color: #cccccc82;
  position: fixed;
  top: 0;
  left: 0;
  animation-name: img;
  animation-duration: 3s;
  //   animation-iteration-count: infinite;

  .messageBox {
    width: 550px;
    height: 200px;
    background: #fff;
    margin: 200px auto;
    .header {
      display: flex;
      justify-content: space-between;
      padding: 10px;
    }
  }
}
@keyframes img {
  0% {
    transform: translate(100px);
  }
  100%{
    transform: translate(800px);
  }
}
</style>
